No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without permission in writing from the publisher. However, you are permitted to make copies of this work, printed or otherwise, as long as said copies are for your personal use only.
-------
Picture this in your mind, if you will: Joe has a part time job at an office with a Mac SE and a nameless 2400 bps modem. His boss has him connect to a mainframe where he collects some information and stuffs it into a spreadsheet. The spreadsheet whips out some charts and Joe print the results on a LaserWriter Plus. Not exciting, but the pay is fairly decent.
The nice thing about this job is that Joe can do some of it at home, where he has an old Mac IIcx and a V.32bis modem. Luckily, the mainframe that he calls can handle high speeds, so things go a lot quicker when he calls from home.
Joe pretty much has everything automated by writing custom MicroPhone scripts. He runs into a problem, though, when he starts doing work at home. He finds that he has to change his settings document around each time he move it from computer to computer. This becomes so annoying, that Joe finally sit down one day and fixes the problem. Now, he can move his floppy disk containing his custom MicroPhone scripts from machine to machine and not worry about what modem he's using. The scripts take care of all of that for him.
How is it Done?
Ask yourself, what is different about the two machines Joe or you will be using? The name? The model? There's definitely something different. Joe decided to use the user name of each machine to differentiate between them. He obtains this information by using an XFCN in MicroPhone called GetUserName. In his settings document, he check the value of GetUserName. If it is the name of his machine at work, he has the script change to the Standard (Autobaud) modem driver. If it is the name of his own machine, he has the script change to the Standard modem driver.
Let's move from Joe's machine to your own. You can take this example one step further. Once you've determined which machine you are using, you can do a variety of things, such as change communication parameters, run different scripts, and even display different icons on the icon bar. For example, if you have access to a utility such as StuffIt(tm) on your machine at home, and you have a script that takes advantage of it, but you don't have StuffIt at work, you can decide not to install the corresponding icon on MicroPhone's icon bar when you are using your settings document at home. Also, if your machine at work has a smaller screen than your home machine, you might want to adjust the size of the terminal window to display more lines on the larger screen. There's a multitude of possibilities.
Starting Points
There are three scripts in this settings document that demonstrate the usefulness of the GetUserName XFCN. They are called "Name?", "Change", and "Reset".
The "Name?" script returns you the result of calling GetUserName. This is useful if you want to know what the user name is for the machine you are on.
The "Change" script demonstrates one way of using GetUserName to make your settings document behave differently, based on what it finds.
The "Reset" script simply restore the settings for the document, so you won't be asked to save them when you quit.
Ideally, you will want to run a script similar to "Change" as your Startup action. You will want to run a script like "Reset" as your Closing action, so you will not be prompted to save your settings document when you quit MicroPhone.
Experiment with the possibilities and explore the options you have. Once you do, you won't want to go back to endless battles of changing parameters and other stuff, just to get things to work right depending on where you are.